/*
 * Copyright © 2018 Cask Data, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
*/

@import "../../../../styles/variables.scss";

$text-color: $grey-01;
$input-label-color: $grey-03;

.configuration-content {
  #engine-config-tab-content {
    .engine-config-radio {
      padding-top: 10px;

      .radio-spark {
        margin-right: 80px;
      }
    }

    .add-custom-config {
      margin-top: 25px;

      a {
        cursor: pointer;

        &.add-custom-config-label {
          margin-top: 5px;
        }

        .fa.fa-caret-down,
        .fa.fa-caret-right,
        .icon-caret-down,
        .icon-caret-right {
          width: 8px;
          color: $text-color;
        }
      }

      hr {
        margin-bottom: 12px;
      }

      .add-custom-config-headers {
        display: flex;
      }

      .key-value-pair-labels {
        display: grid;
        grid-template-columns: 1fr 1fr 62px 100px;
        grid-gap: 10px;
        margin-right: -25px;
      }
      .key-value-pair-preference {
        margin-bottom: 15px;
        justify-content: initial;
        display: grid;
        grid-template-columns: 1fr 1fr auto 100px;
        grid-gap: 10px;
        input {
          width: 100%;
        }
      }
      .custom-config-values {
        /*
          156px = 32px (height of input box) * 3
              + 15px (margin between each boxes) * 3
              + 15px  (container margin top)
          ((32 + 15) * 3) + 15
        */
        max-height: 156px;
        overflow-x: hidden;
        overflow-y: auto;
      }

      .num-rows {
        color: $input-label-color;
        margin-left: 3px;
      }
    }

    &.realtime-content,
    &.allow-force-dynamic-execution {
      .label-with-toggle {
        margin-bottom: 12px;

        .fa.fa-info-circle,
        .icon-info-circle {
          margin-left: 10px;
        }
      }

      .numExecutors {
        .num-executors-tooltip {
          display: inline-block;
        }
        .fa.fa-info-circle {
          margin-left: 5px;
        }
      }

      .add-custom-config {
        margin-top: 5px;

        hr {
          margin-top: 9px;
          margin-bottom: 9px;
        }
      }

      .custom-config-values {
        /*
          141px = 32px (height of input box) * 3
              + 15px (margin between each boxes) * 3
              + 15px  (container margin top)
          ((32 + 15) * 3)
          Contents on the realtime occupies more height than the batch.
          Hence the difference between realtime vs batch.
        */
        max-height: 141px;
        &.key-value-pair-values {
          margin-top: 0;
        }
      }

      .dynamic-execution-select {
        width: 50%;
        margin-bottom: 16px;
      }
    }

    .deprecated-warning {
      font-weight: bold;
      padding: 0 0.25em;
    }
  }
}
